import { requestToData, requestToStatus, commonRequest } from '@/api/commonHttp';
// 待准入商品-未完善 - 架构信息 - 获取架构信息
export const getSchemaInfoService = (data, target) => requestToData({
  url: `/sysback/prepare/commit/structure/queryStructureInfo?productUuid=${data}`,
  type: 'post',
  target
});

// 待准入商品-未完善 - 架构信息 - 提交架构信息
export const submitSchemaInfoService = (data, loadingFn) => requestToStatus({
  url: '/sysback/prepare/commit/structure/saveStructureInfo',
  type: 'post',
  data,
  loadingFn
});

// 列表数据请求
export const getNoPerfectGoodsListService = (data, loadingFn) => commonRequest({
  url: '/sysback/prepare/list/getToBeImprovedAndSubmittedList',
  type: 'post',
  data,
  loadingFn
});

// 列表表格删除
export const deleteNotPerfectGoodsService = (data, loadingFn) => commonRequest({
  url: `/sysback/prepareDelete/deletePreparingSpu?productUuid=${data}`,
  type: 'get',
  loadingFn
});

// 列表勾选项批量提交
export const batchSubmitGoodsService = (data, loadingFn) => commonRequest({
  url: '/sysback/prepare/list/commitByProduct',
  type: 'post',
  data,
  loadingFn,
  isFormData: true
});

// 准入完善 - 基本信息 - 查询单据信息
export const queryPerfectBasicInfoService = (data, loadingFn) => commonRequest({
  url: `/sysback/prepare/commit/basicinfo/queryBasicInfo?productUuid=${data}`,
  type: 'post',
  data,
  loadingFn
});

// 准入完善 - 基本信息 - 提交单据信息
export const savePerfectBasicInfoService = (data, loadingFn) => commonRequest({
  url: '/sysback/prepare/commit/basicinfo/saveBasicInfo',
  type: 'post',
  data,
  loadingFn
});

// 准入完善 - 批量获取品类信息 - 模板导出
export const exportCategoryPredictionsExcelService = (data, loadingFn) => commonRequest({
  url: '/sysback/choose/category/exportCategoryPredictionsExcel',
  type: 'post',
  data,
  loadingFn,
  isExport: true
})

// 准入完善 - 批量获取品类信息 - 导入商品信息
export const importCategoryPredictionsExcelUrl = 'sysback/choose/category/importCategoryPredictionsExcel'
